projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a28f499
)
Fix xenapi_create re: Multiple VIFs for test 04_restore_withdevices_pos
author
Ewan Mellor
<ewan@xensource.com>
Fri, 23 Mar 2007 11:00:08 +0000
(11:00 +0000)
committer
Ewan Mellor
<ewan@xensource.com>
Fri, 23 Mar 2007 11:00:08 +0000
(11:00 +0000)
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
tools/python/xen/xm/xenapi_create.py
patch
|
blob
|
history
diff --git
a/tools/python/xen/xm/xenapi_create.py
b/tools/python/xen/xm/xenapi_create.py
index d4cdb4870f27bf098dfb07d26e42fda968c5a115..dd7f6070516d719f39fe5eb9498b3dc0c5d4b1b8 100644
(file)
--- a/
tools/python/xen/xm/xenapi_create.py
+++ b/
tools/python/xen/xm/xenapi_create.py
@@
-611,7
+611,10
@@
class sxp2xml:
vif = document.createElement("vif")
- dev = get_child_by_name(vif_sxp, "vifname", "eth0")
+ dev = get_child_by_name(vif_sxp, "vifname", None)
+
+ if dev is None:
+ dev = self.getFreshEthDevice()
vif.attributes["name"] \
= "vif" + str(dev.__hash__())
@@
-628,7
+631,8
@@
class sxp2xml:
return vif
+ _eths = -1
-
-
-
+ def getFreshEthDevice(self):
+ self._eths += 1
+ return "eth%i" % self._eths